ConfigContext

class ConfigContext<T : Any>(val config: T)

Holds a config and any applicable secondary flags and their associated information

Author

fzzyhmstrs

Since

0.2.0

Parameters

T

any Non-null type

config

the Config wrapped by this context

Constructors

Link copied to clipboard
constructor(config: T)

Types

Link copied to clipboard
interface Key<C : Any>
Link copied to clipboard
object Keys

Properties

Link copied to clipboard
val config: T

Functions

Link copied to clipboard
fun <C : Any> get(key: ConfigContext.Key<C>): C?

get a generic value from this context, or null if it doesn't exist as the specified type at the specified key

Link copied to clipboard

get an integer value from this context, falling back to 0 if the flag doesn't exist

Link copied to clipboard
fun <C : Any> getOrDefault(key: ConfigContext.Key<C>, fallback: C): C

get a generic value from this context, or null if it doesn't exist as the specified type at the specified key

Link copied to clipboard
fun <C : Any> withContext(key: ConfigContext.Key<C>, value: C): ConfigContext<T>

Adds a flag-info pair into this context. Information should be a boolean or integer value